<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Tables - Ace Admin</title>

<meta name="description" content="Static &amp; Dynamic Tables" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- bootstrap & fontawesome -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/font-awesome.min.css" />
	<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/daterangepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-colorpicker.min.css" />

<!-- page specific plugin styles -->

<!-- text fonts -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css"
	id="main-ace-style" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-part2.min.css" />
		<![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script
	src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="<%=request.getContextPath()%>/ace/assets/js/html5shiv.min.js"></script>
		<script src="<%=request.getContextPath()%>/ace/assets/js/respond.min.js"></script>
		<![endif]-->
</head>

<body class="no-skin">
	<c:if test="${not empty msg}">
    	<div id="myAlert" class="alert alert-warning">
			<a href="#" class="close" data-dismiss="alert">&times;</a>
			<strong>警告！</strong>${msg }。
		</div>
	</c:if>

	<div class="breadcrumbs" id="breadcrumbs">

		<ul class="breadcrumb">
			<li><i class="ace-icon fa fa-home home-icon"></i> <a >当前位置</a>
			</li>

			<li><a href="<%=request.getContextPath()%>/bsbCardBuy/list.do">在线会员卡列表</a></li>
		</ul>
		<!-- /.breadcrumb -->

	</div>

	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<div class="row">
						<div class="col-xs-12">
							<div class="table-header">会员卡管理</div>

							<!-- <div class="dataTables_borderWrap"> -->
							<div>
								<div id="sample-table-2_wrapper"
									class="dataTables_wrapper form-inline no-footer">
									<form action="<%=request.getContextPath()%>/bsbCardBuy/list.do"
										method="get" id="drizzt-table">
										<div class="row">
										<c:if test="${firmId==10000 }">
												<div class="col-xs-12">
												<table cellspacing="0" cellpadding="0" border="0"
													style="float: left; table-layout: auto;"
													class="ui-pg-table navtable">
													<tbody>
														<tr>
															<td class="ui-pg-button ui-corner-all col-xs-3" title=""
																id="add_grid-table" data-original-title="Add new row"><div class="input-group input-group-sm  pull-left"">
																	  <span class="input-group-addon">交易单号:</span>
										            				<input type="text" class="form-control" name="cardbuyId" width="200" value="${cardbuyId }"  placeholder="交易单号">
																</div></td>
															<td>&nbsp;&nbsp;</td>
															<td class="ui-pg-button ui-corner-all col-xs-3" title=""
																id="edit_grid-table"
																data-original-title="Edit selected row">
																<div class="input-group input-group-sm  pull-left">
												
										            			<span class="input-group-addon">用户名:</span>
										            			<input type="text" class="form-control" name="name" width="170" value="${name }"  placeholder="用户名字">
										        				</div></td>
															<td>&nbsp;&nbsp;</td>
															<td class="ui-pg-button ui-corner-all col-xs-3" title="" id="view_grid-table" data-original-title="View selected row">
																<div class="input-group input-group-sm  pull-left">
										            			<span class="input-group-addon">所属机构:</span>
										            			<input type="text" class="form-control" name="firm" width="170" value="${firm }"  placeholder="所属机构">
										        			</div>
										        			</td>
														
														</tr>
													</tbody>
												</table>
											</div>
											<div class="col-xs-12">
												<div class="input-group input-group-sm pull-left">
													
													 &nbsp;&nbsp;&nbsp;
										        	<span class="input-group-addon">购买日期:</span>
										        	
										        	
														<div class="input-daterange" data-date-format="yyyy-mm-dd" id="datepicker">
													    <input type="text" class="input-sm form-control" width="170" name="start" placeholder="起始日期" value="${start }"/>
													  
													    <span class="">--</span>
													    <input type="text" class="input-sm form-control" width="170" name="end" placeholder="截止日期" value="${end }"/>
													
													</div>
													
													</div>
													&nbsp;&nbsp;
												<div id="sample-table-2_filter" class="dataTables_filter pull-left">
													&nbsp;&nbsp;
													<button type="button" onclick="search()" class="btn btn-purple btn-sm">
														<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
														搜索
													</button>
												</div>
											</div>
										
										</c:if>
										
										<c:if test="${firmId!=10000 }">
										<div class="col-xs-12">
												<table cellspacing="0" cellpadding="0" border="0"
													style="float: left; table-layout: auto;"
													class="ui-pg-table navtable">
													<tbody>
														<tr>
															<td class="ui-pg-button ui-corner-all col-xs-3" title=""
																id="add_grid-table" data-original-title="Add new row"><div class="input-group input-group-sm  pull-left"">
																	  <span class="input-group-addon">交易单号:</span>
										            				<input type="text" class="form-control" name="cardbuyId" width="170" value="${cardbuyId }"  placeholder="交易单号">
																</div></td>
															<td class="ui-pg-button ui-corner-all col-xs-3" title=""
																id="edit_grid-table"
																data-original-title="Edit selected row">
																<div class="input-group input-group-sm  pull-left">
												
										            			<span class="input-group-addon">用户名:</span>
										            			<input type="text" class="form-control" name="name" width="170" value="${name }"  placeholder="用户名字">
										        				</div></td>
														
															<td class="ui-pg-button ui-corner-all col-xs-4" title="" id="view_grid-table" data-original-title="View selected row">
																<div class="input-group input-group-sm  pull-left">
                                                                    <span class="input-group-addon">购买日期:</span>
										        	
										        	
														<div class="input-daterange input-group" data-date-format="yyyy-mm-dd" id="datepicker">
													    <input type="text" class="input-sm form-control" width="170" name="start" placeholder="起始日期" value="${start }"/>
													  
													    <span class="input-group-addon">--</span>
													    <input type="text" class="input-sm form-control" width="170" name="end" placeholder="截止日期" value="${end }"/>
													
														</div>
										        			</div>
										        			</td>
															<td class="ui-pg-button ui-corner-all col-xs-2" title="" id="view_grid-table" data-original-title="View selected row">
																<div class="input-group input-group-sm  pull-left">
										            			<button type="button" onclick="search()" class="btn btn-purple btn-sm">
														<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
														搜索
													</button>
										        			</div>
										        			</td>
										        			
														
														</tr>
													</tbody>
												</table>
											</div>
										</c:if>
									
										</div>
										<table
											class="table table-striped table-bordered table-hover dataTable no-footer"
											id="sample-table-2" role="grid"
											aria-describedby="sample-table-2_info">
											<thead>
												<tr role="row">
												<c:if test="${firmId==10000 }">
												<th width="35%" class="sorting_disabled center">交易单号</th>
														<th width="15%" class="sorting_disabled center">用户名</th>
														<th width="15%" class="sorting_disabled center">所属机构</th>
														<th width="25%" class="sorting_disabled center">购买日期</th>
														<th width="10%" class="sorting_disabled center">金额</th>
												</c:if>
												<c:if test="${firmId!=10000 }">
												<th width="40%" class="sorting_disabled center">交易单号</th>
														<th width="20%" class="sorting_disabled center">用户名</th>
														<th width="30%" class="sorting_disabled center">购买日期</th>
														<th width="10%" class="sorting_disabled center">金额</th>
												</c:if>	
														
												</tr>
											</thead>

											<tbody>
												<c:forEach items='${bsbCardBuys}' var="bsbCardBuy">
													<tr role="row" class="odd" align="center">
														
															<td>${bsbCardBuy.uuid}</td>
															<td>${bsbCardBuy.userName}</td>
															<c:if test="${firmId==10000 }">
															<td>${bsbCardBuy.firmName}</td>
															</c:if>
															<td>
															<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${bsbCardBuy.paymentDate}" />
															</td>
															<td>${bsbCardBuy.currentPrice}</td>
															
													</tr>
												</c:forEach>
											</tbody>
										</table>
										<div class="row">
											<div class="col-xs-6">
												<div class="dataTables_info" id="sample-table-2_info"
													role="status" aria-live="polite">
													共 ${totalCount} 条数据，当前第<input type="text" id="pageNum"
														name="pageNum" style="width: 40px;" value="${pageNum}" />页&nbsp;&nbsp;
													<input type="button" class="btn btn-sm btn-primary" value="跳转" onclick="goPage(0)"/>
												</div>
											</div>
											<div class="col-xs-6">
												<div class="dataTables_paginate paging_simple_numbers"
													id="sample-table-2_paginate">
													<ul class="pagination">
														<li class="paginate_button <c:if test="${pageNum==1}">disabled</c:if>"
															aria-controls="sample-table-2" tabindex="0"
															id="sample-table-2_previous"><a href="#"
															onclick="goPage(1)">首页</a></li>
														<li class="paginate_button <c:if test='${pageNum==1}'>disabled</c:if>"
															aria-controls="sample-table-2" tabindex="0"
															id="sample-table-2_previous"><a href="#"
															onclick="goPage(${pageNum}-1)">上一页</a></li>
														<li class="paginate_button <c:if test='${pageNum>=maxPageNum}'>disabled</c:if>" aria-controls="sample-table-2"
															tabindex="0" id="sample-table-2_previous"><a
															href="#" onclick="goPage(${pageNum}+1)">下一页</a></li>
														<li class="paginate_button <c:if test='${pageNum>=maxPageNum}'>disabled</c:if>" aria-controls="sample-table-2"
															tabindex="0" id="sample-table-2_previous"><a
															href="#" onclick="goPage(${maxPageNum})">尾页</a></li>
													</ul>
												</div>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>

</body>

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery
			|| document
					.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.min.js'>"
							+ "<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
	if ('ontouchstart' in document.documentElement)
		document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.mobile.custom.min.js'>"+ "<"+"/script>");
</script>

<script type="text/javascript">
	function goPage(pageNum){
		if(pageNum!=0){
			$("#pageNum").val(pageNum);
		}
		var myreg=/^[0-9]*$/;
		if(!myreg.test($("#pageNum").val())){
			alert("请输入有效数字！");
			$("#pageNum").val(1);
			return false;
		}
		$("#drizzt-table").submit();
	}
	
	function goOperate(operate){
		if(operate=="add"){
			$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbCardBuy/toAdd.do");
			$("#drizzt-table").submit();
		}
		if(operate=="edit"){
			var val=$("#uuid:checked").val();
			if(val==null){
                alert("请选择一条数据");
                return false;
            }else{
				$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbCardBuy/toEdit.do");
				$("#drizzt-table").submit();
            }
		}
		if(operate=="del"){
			var val=$("#uuid:checked").val();
			if(val==null){
                alert("请选择一条数据");
                return false;
            }else{
            	if(confirm("确定要删除该信息吗？删除将不能恢复！")){
            		$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbCardBuy/del.do");
     				$("#drizzt-table").submit();
            	}else{
            		return false;
            	}
            }
		}
		if(operate=="view"){
			var val=$("#uuid:checked").val();
			if(val==null){
                alert("请选择一条数据");
                return false;
            }else{
				$("#drizzt-table").attr("action", "<%=request.getContextPath()%>/bsbCardBuy/view.do");
				$("#drizzt-table").submit();
            }
		}
	}
</script>
<script
	src="<%=request.getContextPath()%>/ace/assets/js/bootstrap-datepicker.min.js"></script>
<script
	src="<%=request.getContextPath()%>/ace/assets/locales/bootstrap-datepicker.zh-CN.min.js"></script>
	
<script type="text/javascript">
jQuery(function($) {
	$("#datepicker").datepicker({
		dateFormat: "yy-mm-dd",
	    todayBtn: "linked",
	    clearBtn: true,
	    language: "zh-CN",
	    autoclose: true,
	    todayHighlight: true

	});
	
})
function search(){
	$("#pageNum").val(1);
	$("#drizzt-table").submit();
}
</script>
<script
	src="<%=request.getContextPath()%>/ace/assets/js/bootstrap.min.js"></script>

<!-- the following scripts are used in demo only for onpage help and you don't need them -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.onpage-help.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/docs/assets/js/themes/sunburst.css" />

</html>
